{% extends 'base.html' %}

{% load static %}

{% block title %}
    用户登录
{% endblock %}

{% block mycss %}
    <link rel="stylesheet" type="text/css" href="{% static 'css/register.css' %}"/>
{% endblock %}

{% block content %}
    {% if msg %}
    <div class="alert alert-warning alert-dismissible fade show" role="alert">
        <strong>{{ msg }}</strong>
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    {% endif %}
    <form class="form-horizontal" action="{% url 'shop:user_login' %}" method="post" id="login_form">
        {% csrf_token %}
        <div class="form-group row">
            <label for="inputEmail3" class="col-sm-4 row justify-content-end col-form-label">用户名：</label>
            <div class="form-inline col-sm-6">
                <input type="text" class=" form-control col-sm-5" id="username" name="username" value="{{ username }}" placeholder="请输入用户名">
                <span id="passwordHelpInline" class="error_tip">
                    提示信息
                </span>
            </div>
        </div>
        {% csrf_token %}
        <div class="form-group row">
            <label for="inputPassword3" class="col-sm-4 row justify-content-end col-form-label">密码：</label>
            <div class="form-inline col-sm-6">
                <input type="password" class=" form-control col-sm-5" id="password" name="password" placeholder="请输入密码">
                <span id="passwordHelpInline" class="error_tip col-sm-5">
                    提示信息
                </span>
            </div>
        </div>
        {% csrf_token %}
        <div class="form-group row">
            <div class="offset-sm-4 col-sm-4 form-inline ">
                <input type="checkbox" class="form-control" id="remember" name="remember">
                <label class="small" for="remember">记住我</label> &nbsp;&nbsp;&nbsp;&nbsp;
                <a class="small" href="{% url 'shop:forget_password' %}"> 忘记密码</a>
            </div>
        </div>
        <div class="form-group row">
            <div class="offset-4 col-sm-10">
                <button type="submit" class="btn btn-primary">用户登录</button>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <a class="" href="{% url 'shop:register' %}">注册</a>
            </div>
        </div>
    </form>
{% endblock %}

{% block myjs %}
<script type="text/javascript"  src="{% static 'js/login.js'%}"></script>
{% endblock %}